<template>
    <div class="search" @click="goodsSearch">
        <van-search
            placeholder="请输入搜索商品"
            shape="round"
            background="red"
            v-model="searchValue"
            @search="goodsSearch"
        />
        <van-card
            v-for="item in list"
            v-moel:price="item.price"
            :desc="item.detail"
            :title="item.product"
            :thumb="item.picture"
            :origin-price="item.oldprice"
            :key="item.id"
            @click="toDetail(item)"
        />
        <van-empty description="空空如也" v-if="visible"/>
    </div>
</template>

<script lang="ts" setup>
import {useSearch } from '@/hooks/search'
import { useToDetail } from "@/hooks/toDetail"
const { toDetail } = useToDetail()
const { goodsSearch,searchValue,list,visible } = useSearch()
</script>

<style scoped lang="scss"></style>
